<%@ page import="com.psl.model.userlogin" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }

%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/assets/css/text.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/main.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/content.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    </script>
    <style>
        #title {
            border: 0px;
            margin-bottom: 10px;
        }

        #title td {
            height: 20px;
            line-height: 150%;
            background-image: url(/assets/img/dot_02.gif);
            background-position: left top;
            background-repeat: no-repeat;
            font-size: 15px;
            font-weight: bold;
            color: #CC0000;
            letter-spacing: 2px;
        }
    </style>
    <style media="print">
        .nobtn {
            display: none;
        }
    </style>
</head>
<body>


<table cellspacing="0" cellpadding="0" id="title" align="center">
    <tbody>
    <tr>
        <td nowrap="nowrap">
            山东宜利达流体设备有限公司组装铸件(切换 <a href="halfcoating_pj_bring.jsp"> 配件</a>)领料表
        </td>
    </tr>
    </tbody>
</table>
<table cellpadding="0" cellspacing="0" class="datalist" align="center">
    <tr>
        <th colspan="1">编号</th>
        <th colspan="1">名称</th>
        <th colspan="1">规格</th>
        <th colspan="1">操作</th>
    </tr>
    <form action="/gethname1.do" method="post">
        <tr>
            <td align="center" colspan="1"></td>
            <td align="center" colspan="1"><input name="h_name" type="text" value=""></td>
            <td align="center" colspan="1"><input name="h_size" type="text" value=""></td>
            <td align="center" colspan="1"><input type="submit" value="查询"/></td>
        </tr>
    </form>
    <c:if test="${not empty query}">
        <c:forEach items="${query}" var="q" varStatus="status">
            <script>
                function add ${status.count}() {
                    document.getElementById("h_no").value = document.form${status.count}.no.value;
                    document.getElementById("h_name").value = document.form${status.count}.name.value;
                    document.getElementById("h_size").value = document.form${status.count}.size.value;
                }
            </script>
            <form name="form${status.count}">
                <tr class="change">
                    <td align="center" colspan="1"><input type="hidden" id="no${status.count}" name="no"
                                                          value="${q.h_no}"/> ${q.h_no}</td>
                    <td align="center" colspan="1"><input type="hidden" id="name${status.count}" name="name"
                                                          value="${q.h_name}"/>${q.h_name}</td>
                    <td align="center" colspan="1"><input type="hidden" id="size${status.count}" name="size"
                                                          value="${q.h_size}"/>${q.h_size}</td>
                    <td align="center" colspan="1"><input type="button" value="添加" onclick="add${status.count}()"/></td>
                </tr>
            </form>
        </c:forEach>
    </c:if>
    </tbody>
</table>


<table border="0" align="center" cellpadding="3" cellspacing="1" class="datalist">
    <tbody>
    <tr>
        <td colspan="5" height="45"></td>
        <td height="45"><input class="nobtn" type="button" value="打印" class="nobtn"
                               onclick="window.print();">
        <td height="25" colspan="1" align="center"><a href="/bring_log.do" class="nobtn">查看领料记录</a>&nbsp;&nbsp;&nbsp;&nbsp;
        </td>
    </tr>
    <tr>
        <td align="center">铸件/配件编号</td>
        <td height="25" align="center">铸件/配件名称</td>
        <td align="center">规格</td>
        <td align="center">商标</td>
        <td align="center">压力</td>
        <td align="center">领取数量</td>
        <td align="center">领取时间</td>
    </tr>
    <form action="/jjgapprove.do" method="post">
        <tr>
            <td align="center"><input class="nobtn" type="text" id="h_no" name="h_no" value=""></td>
            <td align="center"><input class="nobtn" type="text" id="h_name" name="h_name" value=""></td>
            <td align="center"><input class="nobtn" type="text" id="h_size" name="h_size" value=""></td>
            <td align="center">
                <select name="h_r" class="nobtn">
                    <option value="TVT">TVT</option>
                    <option value="PSL">PSL</option>
                    <option value="SK">SSK</option>
                    <option value="SI">SI</option>
                    <option value="other">other</option>
                </select>
            </td>
            <td align="center">
                <select name="h_n" class="nobtn">
                    <option value="16">16</option>
                    <option value="10">10</option>
                    <option value="25">25</option>
                </select>
            </td>
            <td align="center"><input class="nobtn" type="number" name="h_bring_num" value=""></td>
            <td align="center"><input class="nobtn" type="date" name="h_bring_datetime" value=""><input class="nobtn"
                                                                                                        type="submit"
                                                                                                        value="领取"></td>
        </tr>
    </form>
    <tr>
        <td align="center" height="25"></td>
        <td align="center"></td>
        <td align="center"></td>
        <td align="center"></td>
        <td align="center"></td>
        <td align="center"></td>
        <td align="center"></td>
    </tr>
    <tr>
        <th align="center">铸件/配件编号</th>
        <th height="25" align="center">铸件/配件名称</th>
        <th align="center">规格</th>
        <th align="center">商标</th>
        <th align="center">压力</th>
        <th align="center">铸件库存剩余数量</th>
        <th align="center">领取时间</th>
    </tr>
    <c:forEach items="${jjg}" var="z">

        <tr>
            <td height="25" align="center">${z.h_no}
            </td>
            <td height="25" align="center">${z.h_name}
            </td>
            <td height="25" align="center">${z.h_size}
            </td>
            <td height="25" align="center">${z.h_r}
            </td>
            <td height="25" align="center">${z.h_n}
            </td>
            <td height="25" align="center">${z.h_bring_num}
            </td>
            <td height="25" align="center">${z.h_bring_datetime}
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>

</body>
</html>